package email;
/**
 * This class implements the email message to the system.
 * 
 * @author Alexandre, Cristovao, Raul, Rodolpho, Tales
 * 
 */
public class EmailMessage {

	private final String LINE_SEPARATOR = System.getProperty("line.separator");
	private String from;
	private String to;
	private String subject;
	private String message;

	/**
	 * Constructor
	 * 
	 * @param from
	 *            - user who want to send the message
	 * @param to
	 *            - user who will receives the message
	 * @param subject
	 *            - the subject of the message
	 * @param message
	 *            - the message
	 */
	public EmailMessage(String from, String to, String subject, String message) {
		this.from = from;
		this.to = to;
		this.subject = subject;
		this.message = message;
	}

	/**
	 * Get the user who send the message
	 * 
	 * @return user who sent the message
	 */
	public String getFrom() {
		return from;
	}

	/**
	 * Get the user who receives the message
	 * 
	 * @return user who received the message
	 */
	public String getTo() {
		return to;
	}

	/**
	 * Get the subject of the message
	 * 
	 * @return subject of the message
	 */
	public String getSubject() {
		return subject;
	}

	/**
	 * Get the message of the email.
	 * 
	 * @return message of the email
	 */
	public String getMessage() {
		return message;
	}

	/**
	 * Get the full email (from, to, subject and message)
	 * 
	 * @return email
	 */
	public String getFinalMessage() {
		
		String finalMessage = "";
		finalMessage += ("From: " + getFrom() + LINE_SEPARATOR);
		finalMessage += ("to: " + getTo() + LINE_SEPARATOR);
		finalMessage += ("Subject: " + getSubject() + LINE_SEPARATOR + LINE_SEPARATOR);

		finalMessage += (getMessage() + LINE_SEPARATOR);
		finalMessage += (LINE_SEPARATOR
				+ "***************************************************************************************************" + LINE_SEPARATOR);
		return finalMessage;
	}

}
